let layer
$(function () {
    layui.use(['layer', 'form', 'element'], function () {
        layer = layui.layer, form = layui.form, element = layui.element;
    })
})

/**
 * 提交购物车
 * @param id
 */
function submit(id, carId) {
    location.href = api.OrderInfo + '?productId=' + id + '&carId=' + carId
}

/**
 * 商品详情
 * @param productId
 */
function querySingle(productId) {
    location.href = api.ProductInfo + '?id=' + productId
}

/**
 * 删除购物车
 * @param id
 */
function del(id) {
    layer.confirm('确认要删除该商品吗？删除后无法恢复。', {title: '警告框'}, function (index) {
        location.href = api.DeleteCar + '?id=' + id
    })
}